﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Samples.ServiceHosting.StorageClient;

namespace Ciripescu_WebRole.Entities
{
    public class Invite : TableStorageEntity
    {
        // adresa de email este partition key

        public int NbOfTimes { get; set; }
        public DateTime LastInvite { get; set; }
        public string Name { get; set; }
        public bool noMoreEmails { get; set;}
        public string Version { get; set; }

        /// <summary>
        /// lista despartita de spatii cu userii care l-ai invitat pe Ciripescu
        /// </summary>
        public string UsersWhoInvitedHim { get; set; }
        public Invite(string email, string Name, int nbOfTimes, DateTime lastInvite)
            : base(email, string.Format("{0:D19}", DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks))
        {
            this.NbOfTimes = nbOfTimes;
            this.LastInvite = lastInvite;
            this.Name = Name;
            this.noMoreEmails = false;
            this.UsersWhoInvitedHim = string.Empty;
            this.Version = Properties.Settings.Default.Version;
        }
        public Invite()
        {
        }
        public string getEmail()
        {
            return PartitionKey;
        }
    }
}
